import axiosHttp from '@/lib/axiosHttp';
function getQueryString(name) {
    var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
    var r = window.location.search.substr(1).match(reg);
    if (r != null) {
    return unescape(r[2]);
    }
    return null;
  }
const api = {
     // 获取公司部门
    companyDepartments: function(){
        return axiosHttp.get("/companies/departments/tree");
    },
    getDeps:function(){
        return axiosHttp.get(`/companies/21db6a365d2f1254dac92f9ec314deaa/departments/tree`);
    },
    // 获取指定部门下的人员
    departmentsUser: function(id){
        return axiosHttp.get(`/departments/${id}/users`);
    },
    getChildUser:function(id,companyId,Keyword){
        var params = {
            Company_Id:companyId,
            limit: 1,
            size: 1000,
            Keyword:Keyword,
            Department_Id:id
        }
        return axiosHttp.get(`/users/page`,{
            params:params,
        })
    }
    
}

export default api